package com.encapi.framework.exception;

/**
 * 异常工具类
 * @author xzbcode
 */
public class ExceptionUtil {

    public static ApiCryptException buildCryptEx(String errorMsg, Object ... args) {
        return new ApiCryptException(String.format(errorMsg, args));
    }

    public static ApiCryptException buildCryptEx(String errorMsg, Throwable cause, Object ... args) {
        return new ApiCryptException(String.format(errorMsg, args), cause);
    }

    public static DecryptBodyException buildDecryptEx(String errorMsg, Object ... args) {
        return new DecryptBodyException(String.format(errorMsg, args));
    }

    public static EncryptBodyException buildEncryptEx(String errorMsg, Object ... args) {
        return new EncryptBodyException(String.format(errorMsg, args));
    }

}
